package demo03;

import java.util.Arrays;
import java.util.function.Function;

/**
 * @author: WangPeng
 * @createTime: 2022/11/03 20:27
 * @description:
 * @version: v1.0
 */
public class TestFuncation {
    public static void main(String[] args) {
        Function<String[],Integer> function =str -> {
            return str.length;
        };
        String[] aa = {"aa","bb","cc","dd"};
        fun(function,aa);
    }
    public static void fun(Function<String[],Integer>function,String[] str){
        Integer apply = function.apply(str);
        System.out.println(apply);
    }
}
// Funcation<T,R> 函数型函数式接口;
// T:参数的泛型,R: 返回值的泛型
//这种函数式接口需要参数和有返回值。